<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\widgets\LinkPager;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Alert;
use yii\captcha\Captcha;
$this->params['breadcrumbs'][] = $this->title;

?>
  <div class="mcCont mcgCont">
      <div class="right resetPassword">
        <h1 class="tt">修改密码</h1>
        <div class="setArea">
        <?php $form = ActiveForm::begin(['method'=>'post','options' => ['class' => 'positionr']]);?>
          <p class="item errorBor"><span class="itemTt">当前密码</span> 
          <?= $form
                  ->field($model, 'password_hash',['options'=>['class'=>'item']])
                  ->label(false)
                  ->error(['style' => 'color:red;font-size:10px;'])
                  ->passwordInput(['placeholder' => $model->getAttributeLabel('password_hash'),'class'=>'input1']) ?>
                    
          </p>
           <!-- </p> -->
          <!--当密码输入错误次数超过三次-->  
          <!-- <p class="item errorBor"><span class="itemTt">请输入验证码</span><input type="password" class="input2"><span class="yanzhengma"></span> <span class="errorTxt">请输入图片验证码</span></p> -->

          <p class="item"><span class="itemTt">新密码</span>
         <?= $form
                  ->field($model, 'pass1',['options'=>['class'=>'item']])
                  ->label(false)
                  ->error(['style' => 'color:red;font-size:10px;'])
                  ->passwordInput(['placeholder' => $model->getAttributeLabel('pass1'),'class'=>'input1']) ?>
           </p>       
                  <!-- <span class="errorTxt">请输入新密码</span> -->
          <p class="item"><span class="itemTt">确认密码</span>
          <?= $form
                  ->field($model, 'pass2',['options'=>['class'=>'item']])
                  ->label(false)
                  ->error(['style' => 'color:red;font-size:10px;'])
                  ->passwordInput(['placeholder' => $model->getAttributeLabel('pass2'),'class'=>'input1']) ?>
          <?= $form
                  ->field($m, 'verifyCode',['options'=>['class'=>'item']])
                  ->label(false)
                  ->error(['style' => 'color:red;font-size:10px;'])
                  ->widget(Captcha::className(), [
            'template' => '<div class="row">{image}<input id="loginform-verifycode" style="widget:150px;height:32px;border: 1px solid #dcdcdc;" type="text" name="LoginForm[verifyCode]"></div>',
        ]) ?>
                 
          <!-- <span class="errorTxt">请输入新密码</span> --></p>
         <?= Html::submitButton('保存', ['class' => 'btn-small-default setConfirm']) ?>

            <?php ActiveForm::end(); ?>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  $(function(){
    var success = <?php echo $error;?>;
    if(success == 1){
      layer.msg('密码输入不一致……', {time: 1000}, function(){
        window.location.href = "/account/resetpassword";
       });
    }else{
      if(success == 2){
      layer.msg('旧密码错误……', {time: 1000}, function(){
        window.location.href = "/account/resetpassword";
       });
    }
    }
  })
</script>